const db = wx.cloud.database({
  throwOnNotFound: false
})
const _ = db.command
Page({
  data: {
    historyList: []
  },

  onLoad: function () {
    wx.cloud.callFunction({ //调用云函数获取openid
      name: "getOpenId",
      complete: res => {
        console.log("openid:",res)
        wx.cloud.callFunction({
          name: "queryHistory",
          data: {
            openid: res.result.openid
          },
          complete: res => {
            console.log("查找用户明细信息成功", res)
            if (res.result.data.length >= 1) {
              this.setData({
                historyList: res.result.data
              })

            } else {
              console.log("用户无明细信息")
            }
          }

        })

      }
    });

  }



})